/**
 * 商品相关Mock数据
 */

// 模拟延迟
export const mockDelay = (ms = 500) => {
  return new Promise(resolve => setTimeout(resolve, ms))
}

// 模拟API响应格式
export const mockApiResponse = (data, success = true, message = 'success') => {
  return {
    code: success ? 200 : 500,
    message,
    data,
    success
  }
}

// 模拟商品列表数据
export const mockGoodsList = {
  items: [
    {
      id: 1,
      goods_name: '高效杀虫剂',
      price: 45.00,
      originalPrice: 60.00,
      sales_quantity: 1200,
      specs: [{
        img_url: 'https://via.placeholder.com/300x300?text=杀虫剂',
        retail_price: 45.00,
        original_price: 60.00
      }]
    },
    {
      id: 2,
      goods_name: '有机肥料',
      price: 35.00,
      originalPrice: 50.00,
      sales_quantity: 800,
      specs: [{
        img_url: 'https://via.placeholder.com/300x300?text=肥料',
        retail_price: 35.00,
        original_price: 50.00
      }]
    }
  ]
}

// 模拟商品详情数据
export const mockGoodsDetail = {
  description: '高效杀虫剂，适用于多种农作物',
  specifications: '500ml/瓶',
  usage: '按说明书使用',
  precautions: '请远离儿童'
} 